package cn.aran.feign;

import cn.aran.utils.AjaxResult;
import cn.aran.vo.ProductVo;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;


@Component
public class StoreFeignClientFallbackFactory implements FallbackFactory<StoreFeignClient> {
    @Override
    public StoreFeignClient create(Throwable throwable) {
        return new StoreFeignClient() {
            @Override
            public AjaxResult addStore(ProductVo productvo) {
                throwable.printStackTrace();
                return AjaxResult.me().setSuccess(false).setMessage("仓库服务不可用!");
            }
        };
    }
}
